# -*- coding: utf-8 -*-

from odoo import models, fields

from ..utils.settings import Settings


class ExhibitionApplicationConfig(models.TransientModel):
    _name = 'exhibition.app_config'
    _inherit = 'res.config.settings'

    page_size = fields.Integer(config_parameter='exhibition.page_size', string='分页大小')
    attachment_url_prefix = fields.Char(config_parameter='exhibition.attachment_url_prefix', string='附件URL前缀')
    exhibit_page_path = fields.Char(config_parameter='exhibition.exhibit_page_path', string='小程序展品页面路径')
    label_card_width = fields.Integer(config_parameter='exhibition.label_card_width', string='展品标签卡宽度')
    video_on = fields.Boolean(config_parameter='exhibition.video_on', string='是否开启视频')
    video_url_prefix = fields.Char(config_parameter='exhibition.video_url_prefix', string='视频URL前缀')

    def set_values(self):
        Settings.dereference()
        return super().set_values()
